- convert the integer to a string
- iterate through the string, flip the first 6 we encounter to a 9
- return stoi(str)
π€What Did I Struggle With?
remembering the to_string function
π‘ Explanation of Solution
initial thoughts capture the correct approach
β Complexity Analysis
Time Complexity: O(n)
- we are conducting a single path through of the input array
Space Complexity: O(1)
- no additional space is required to solve this problem as we are manipulating the input string