A handy cheatsheet to make your way down when you’re in the final stages of a golf challenge looking to shave off those last few characters.
This is a living document and I’ll be updating it as time goes on.
Print the nth row of Pascal’s triangle.
Example:
Pascal_triangle(2) = [1, 1]
You are given an integer N. Your task is to calculate three sums S1, S2, S3, such that:
S1 is the sum of first N positive integers
S2 is the sum of first N positive odd integers
Given a list of integers, find the longest increasing contiguous sequence in it. If there are several answers, return the first one.
LargestSequence([2,3,6,7,5,3,2…
A best-of-n series between two teams is played over n games or less, where n is a positive odd integer. The outcome of the games is always win or lose; no draws occur. The first team to win (n + 1) / 2 games wins the…