Given an integer n, return true if it is a power of four. Otherwise, return false. An integer n is a power of four if there exists an integer x such that n == 4^x.
Given an integer n, simulate a process on a list of integers from 1 to n where every other number is removed, alternating the direction from left to right and right to left until only one number remains. Return the last remaining number.
You are given a string that is encoded using the pattern k[encoded_string], where the substring inside the square brackets is repeated exactly k times. Your task is to decode the string by expanding it according to the given encoding rule.
You are given an integer array nums. Two players, Player 1 and Player 2, take turns to pick numbers from either end of the array. Each player adds the selected number to their score. The goal is to determine if Player 1 can win the game. Player 1 wins if they have a higher score or if the scores are tied.
The Fibonacci sequence is a series of numbers where each number is the sum of the two preceding ones, starting from 0 and 1. Given an integer n, return the nth Fibonacci number.