Category: code
A string is called a happy prefix if is a non-empty prefix which is also a suffix (excluding itself). Given a string s. Return the longest happy prefix of …
Given the root of a binary tree, find the maximum value V for which there exists different nodes A and B where V = |A.val – B.val| and A …
Given an array A of integers, we must modify the array in the following way: we choose an i and replace A with -A, and we repeat this process …
The Tribonacci sequence Tn is defined as follows: T0 = 0, T1 = 1, T2 = 1, and Tn+3 = Tn + Tn+1 + Tn+2 for n >= 0. …
Given an array of integers A, return the largest integer that only occurs once. If no integer occurs once, return -1. Example 1: Input: Output: 8 Explanation: The maximum …