Most of the times, maths helps us solve the question within the necessary time constraints.Īll of the topics can’t be covered in a single article but we’ll be looking into some of the most common mathematical concepts in competitive coding. All the algorithms that we learn are derived from a mathematical point of view. A majority of the Competitive Coding problems that you’ll encounter will have some mathematical logic or trick. But maths becomes essential as you dive deep into the world of CP. You can definitely start competitive coding without any mathematical background. But there are some concepts and tricks which are sufficient most of the times. Top 50 Array Coding Problems for InterviewsĬompetitive Programming ( CP) doesn’t typically require to know high-level calculus or some rocket science.Euclidean algorithms (Basic and Extended).Modular Exponentiation (Power in Modular Arithmetic).Write an iterative O(Log y) function for pow(x, y).Factorial of Large numbers using Logarithmic identity.Program to check if a given year is leap year.
Basic number theory codechef how to#
How to swap two numbers without using a temporary variable?.
GATE CS Original Papers and Official Keys.