Math

Minimum Cost to Merge Stones

Roman to Integer LeetCode Solution | Easy Approach

Roman to Integer | Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral, just two one’s added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + …

Roman to Integer LeetCode Solution | Easy Approach Read More »

Palindrome Number Leetcode Solution | Easy Approach

Palindrome Number Leetcode | Given an integer x, return true if x is palindrome integer. An integer is a palindrome when it reads the same backward as forward. For example, 121 is a palindrome while 123 is not. Example 1: Input: x = 121 Output: true Explanation: 121 reads as 121 from left to right and from right to left. Example 2: Input: x = -121 …

Palindrome Number Leetcode Solution | Easy Approach Read More »

Reverse Integer Leetcode Solution | C++ | Java | Python | Easy

Given a signed 32-bit integer x, return x with its digits reversed. If reversing x causes the value to go outside the signed 32-bit integer range [-231, 231 – 1], then return 0. Assume the environment does not allow you to store 64-bit integers (signed or unsigned). Example 1: Input: x = 123 Output: 321 Example 2: Input: x = -123 Output: -321 …

Reverse Integer Leetcode Solution | C++ | Java | Python | Easy Read More »

Minimum Cost to Merge Stones

Integer to Roman Leetcode Solution | Easy Approach

Integer to Roman | Roman numerals are represented by seven different symbols: I, V, X, L, C, D and M. Symbol Value I 1 V 5 X 10 L 50 C 100 D 500 M 1000 For example, 2 is written as II in Roman numeral, just two one’s added together. 12 is written as XII, which is simply X + II. The number 27 is written as XXVII, which is XX + V + …

Integer to Roman Leetcode Solution | Easy Approach Read More »

Minimum Cost to Merge Stones

Add Two Numbers Leetcode Solution | C++, Java, Python | Easy Approach

Add Two Numbers | You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order, and each of their nodes contains a single digit. Add the two numbers and return the sum as a linked list. You may assume the two numbers do not contain any leading zero, except the number 0 …

Add Two Numbers Leetcode Solution | C++, Java, Python | Easy Approach Read More »

x