Input: "hello"
Output: "olleh"
function reverseString(str) {
return str.split("").reverse().join("");
}
// Example usage:
let output = reverseString("hello")
console.log(output); // Output: "olleh"Input: "I love coding"
Output: "coding love I"
Input: "madam"
Output: true
Input: "hello"
Output: { vowels: 2, consonants: 3 }
Input: "listen", "silent"
Output: true
Input: [4, 1, 9, 3]
Output: 9
function findLargest(arr) {
// Logic
}
let myArr = [4, 1, 9, 3]
let output = findLargest(myArr)
console.log(output); // Output: 9
Input: [4, 1, 9, 3]
Output: 1
Input: [10, 20, 4, 45, 99]
Output: 45
Input: [1, 2, 2, 3, 3, 4]
Output: [1, 2, 3, 4]
Input: [1, 2, 2, 3]
Output: {1:1, 2:2, 3:1}
Input: [1, 2, 3, 4]
Output: true
Input: [1, 2, 3]
Output: 6
Input: [1, 2, 3, 4]
Output: {even: 6, odd: 4}
Input: [2, 4, 6]
Output: 4
Input: [1, 2, 4, 5]
Output: 3
Input: [1,2,3], [2,3,4]
Output: [2,3]
Input: [1,2,3], [3,4,5]
Output: [1,2,3,4,5]
Input: [1,2,3,4,5], k=2
Output: [4,5,1,2,3]
Input: [0,1,0,3,12]
Output: [1,3,12,0,0]
Input: [1,3,5], [2,4,6]
Output: [1,2,3,4,5,6]
Input: "I love programming"
Output: "programming"
Input: "a b c d"
Output: "abcd"
Input: "hello world"
Output: "Hello World"
Input: "aabbcd"
Output: "c"
Input: "aabbc"
Output: ["a","b"]
Input: 5
Output: 120
Input: 6
Output: [0,1,1,2,3,5]
Input: 7
Output: true
Input: 1 to 10
Output: [2,3,5,7]
Input: 153
Output: true
Input: 6, 8
Output: {GCD: 2, LCM: 24}
Input: 10
Output: "1010"
Input: "1010"
Output: 10
Input: 12345
Output: 5
Input: 1234
Output: 4321
Input: 121
Output: true
Input: 112233
Output: {1:2, 2:2, 3:2}
Output: 1,2,4,5,7,8,...
Output: Multiples of 3 → Fizz, of 5 → Buzz, both → FizzBuzz
Input: min=1, max=10
Output: A number between 1–10
Input: [3,1,2]
Output: [1,2,3]
Input: [10,4,6]
Output: min=4, max=10
Input: [1,2,3,2], target=2
Output: [1,3]
Input: [1,2,3,4], target=5
Output: [(1,4),(2,3)]
Input: [1,2,3], target=6
Output: false
Input: [1, [2, 3], [4]]
Output: [1,2,3,4]
Input: [1,2,3,4,5], size=2
Output: [[1,2],[3,4],[5]]
Input: [1, -2, 0, 3]
Output: {positive:2, negative:1, zero:1}
Input: [1,-2,3,-4]
Output: [1,0,3,0]
Input: a=5, b=10
Output: a=10, b=5