Tag: python
Implement the class ProductOfNumbers that supports two methods: 1. add(int num) Adds the number num to the back of the current list of numbers. 2. getProduct(int k) Returns the …
Determine whether an integer is a palindrome. An integer is a palindrome when it reads the same backward as forward. Example 1: Input: 121 Output: true Example 2: Input: …
Given an array of integers, find if the array contains any duplicates. Your function should return true if any value appears at least twice in the array, and it …
Given an integer n. No-Zero integer is a positive integer which doesn’t contain any 0 in its decimal representation. Return a list of two integers where: A and B …
Reversing a List/Array is very commonly needed and there are three ways to reverse a list or array in Python. Using the .reverse() method to reverse a list or …