Competitive Programming Retake Questions
Competitive Programming Retake Questions
TECHCON 2024
Competitive Programming
1. Vowel Counter:
Prompt: Write a program that counts the number of vowels in a given string.
2. Fibonacci Sequence:
Prompt: Write a program that generates the first 20 numbers of the Fibonacci sequence.
Input: None.
3. Armstrong Number:
5. Largest Number:
Prompt: Write a program to find the largest number among three given numbers.
6. Factorial Calculator:
7. Sorting Numbers:
Input: A sentence.
8. ACCITC is holding a cricket tournament and the first match is between Arafat's team
and Galib's team. Many people worldwide have come to watch this game and you are
also among them.
Now you want to count how many balls there are in an over. Arafat's team is batting and
Galib's team if bowling.
Given a series of outcomes of balls bowled by a bowler, you have to determine the
number of legal balls and the number of overs that have been played. The following are
the possible outcomes of each ball:
The input will be a string S (length S<100) which represents the outcome of each ball.
And there will be at least 1 legal ball.
You are given a grid with m rows and n columns. A robot starts at the top-left cell (0, 0)
and wants to reach the bottom-right cell (m-1, n-1). The robot can only move right or
down. Calculate the number of unique paths the robot can take to reach its destination.
Input:
Two integers, m and n, representing the number of rows and columns in the grid.
Output:
An integer representing the number of unique paths from the top-left to the bottom-right
cell
Given a list of email addresses, filter out the invalid ones based on the specified format.
An email address is considered invalid if it does not adhere to the format
username@domain. The username and domain can only contain letters (a-z, A-Z),
numbers (0-9), dots (.), and must have a valid structure.
Input:
A list of strings, each representing an email address.
Output:
A list of valid email addresses, filtered from the input list.
You are given a list of integers. Determine if there exist any three integers in the list that
can form a Pythagorean triplet (a² + b² = c²).
Input:
A list of integers.
Output:
Print "Yes" if there exist three integers in the list forming a Pythagorean triplet;
otherwise, print "No".
Given two strings, determine if they are anagrams. Two strings are considered
anagrams if they contain the same letters in different arrangements. The comparison is
case-sensitive, and only consider letters (ignore spaces, punctuation, and other
characters).
Input:
Two strings, each containing only alphabets (a-z or A-Z) and having a length between 1
and 10^5.
Output:
Print "Yes" if the given strings are anagrams; otherwise, print "No".
13. Jorda guessed three positive integers a, b, c and he wants to keep it as a secret. He
writes the pairwise sum of the 3 numbers and the sum of all numbers on a board. (a+b,
b+c, c+a, a+b+c).
Your job is to guess the 3 hidden numbers.
In input, you will be given 4 integers x1, x2, x3, x4, in any order.
In output, you have to write the 3 guessed integer.