CUHP DEVS Logo
Guest User

Coding Challenges

Master algorithms and data structures with curated problems.

EASY

Two Sum

# Two Sum ## Problem Statement Given two integers, return their sum. You need to implement a function that takes two integers as input and returns a single integer which is their addition. --- ## Input Two integers: a = first number b = second number --- ## Output Return a single integer representing the sum of the two numbers. --- ## Example 1 Input: a = 2 b = 3 Output: 5 --- ## Example 2 Input: a = -10 b = 25 Output: 15 ---

72.4% SuccessBadge Available
EASY

Valid Parentheses

# Valid Parentheses ## Problem Statement Given a string consisting of the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. A string is considered valid if: - Open brackets are closed by the same type of brackets. - Open brackets are closed in the correct order. - Every closing bracket has a corresponding opening bracket of the same type. You need to implement a function that takes a string as input and returns a boolean value indicating whether the string is valid. --- ## Input A single string: s = input string containing only the characters '(', ')', '{', '}', '[' and ']' --- ## Output Return `true` if the string is valid, otherwise return `false`. --- ## Example 1 Input: s = "()" Output: true --- ## Example 2 Input: s = "()[]{}" Output: true --- ## Example 3 Input: s = "(]" Output: false --- ## Example 4 Input: s = "([)]" Output: false --- ## Example 5 Input: s = "{[]}" Output: true ---

85.2% SuccessBadge Available