// Returns the number of formatting arguments in the provided string. Does not
// count escaped % symbols, specifically the string "%%".
//
//   fmt.Println(numFmtArgs("rate: %d%%"))  // 1
Returns the number of formatting arguments in the provided string. Does not
count escaped % symbols, specifically the string "%%".


// Returns the number of formatting arguments in the provided string . Does not // count escaped % symbols specifically the string " %% " . // // fmt . Println ( numFmtArgs ( " rate : %d%% " )) // 1
func numFmtArgs(s string) int {
	var (
		count   int
		percent bool 
	)
	for _, c := range s {
		if percent && c != '%' {
			count++
		}
		percent = !percent && c == '%'
	}
	return count
}
func numFmtArgs ( s string ) int { var ( count int percent bool ) for _ , c := range s { if percent && c != '%' { count ++ } percent = ! percent && c == '%' } return count }
Returns the number of formatting arguments in the provided string.
Returns the number of formatting arguments in the provided string .
// saw % // Counts only if it's not a %%. // Next iteration should consider % only if the current % // stands alone.