// LastIndexN returns the nth occurrence of sep in s or -1 if there is no nth
// occurrence of sep. Searching is going from the end of the string to the start.
LastIndexN returns the nth occurrence of sep in s or -1 if there is no nth
occurrence of sep. Searching is going from the end of the string to the start.
// LastIndexN returns the nth occurrence of sep in s or - 1 if there is no nth // occurrence of sep . Searching is going from the end of the string to the start .
func LastIndexN(s, sep string, n int) int {
	if n == 0 {
		return -1 
	}
	sepIdx := len(s)
	for i := 0; i < n; i++ {
		sepIdx = strings.LastIndex(s[:sepIdx], sep)
		if sepIdx == -1 {
			return -1 
		}
	}
	return sepIdx
}
func LastIndexN ( s , sep string , n int ) int { if n == 0 { return - 1 } sepIdx := len ( s ) for i := 0 ; i < n ; i ++ { sepIdx = strings . LastIndex ( s [ : sepIdx ] , sep ) if sepIdx == - 1 { return - 1 } } return sepIdx }
LastIndexN returns the nth occurrence of sep in s or -1 if there is no nth
occurrence of sep. Searching is going from the end of the string to the start.
LastIndexN returns the nth occurrence of sep in s or - 1 if there is no nth occurrence of sep . Searching is going from the end of the string to the start .
// ### return, nonsense ### // ### return, not found ###