You are given a singly linked list node containing positive integers. Return the same linked list where every node’s next points to the node val nodes ahead. If there’s …
Given a singly linked list node, and an integer target, return the same linked list with all nodes whose value is target removed. Example 1 Input node = 0 …
The Fibonacci sequence goes like this: 1, 1, 2, 3, 5, 8, 13, 21, 34, … The next number can be found by adding up the two numbers before …
Given a positive integer num, return the sum of its digits. Bonus: Can you do it without using strings? Example 1 Input num = 123 Output 6 Explanation Since …
Given a string s, determine whether it has all unique characters. Example 1 Input s = “abcde” Output true Explanation All characters only occur once Example 2 Input s …
Let’s call any (contiguous) subarray B (of A) a mountain if the following properties hold: B.length >= 3 There exists some 0 < i < B.length – 1 such …