Given a zero-based permutation nums (0-indexed), build a new array ans of the same length where for each i, ans[i] = nums[nums[i]]. Return the array ans. A zero-based permutation means that the array consists of distinct integers from 0 to nums.length - 1 (inclusive).
Given an integer n, count how many square triples (a, b, c) satisfy the equation a^2 + b^2 = c^2 where 1 <= a, b, c <= n. The order of a, b, and c matters.
You are given a string ’text’ consisting of words separated by a single space and a string ‘brokenLetters’ containing the broken keys on a malfunctioning keyboard. Return the number of words in ’text’ that can be fully typed using the working keys.
You are given a string consisting of lowercase English letters and an integer k. Your task is to convert the string into an integer by replacing each letter with its corresponding position in the alphabet (where ‘a’ = 1, ‘b’ = 2, …, ‘z’ = 26), and then repeatedly sum its digits k times. The final result is the integer obtained after performing the digit sum operation k times.