You are on page 1of 5

Adamjee Cantonment College IT Club

TECHCON 2024
Competitive Programming

1. Vowel Counter:

Prompt: Write a program that counts the number of vowels in a given string.

Input: A string of text.

Output: The total count of vowels (a, e, i, o, u) within the string.

2. Fibonacci Sequence:

Prompt: Write a program that generates the first 20 numbers of the Fibonacci sequence.

Input: None.

Output: The first 20 Fibonacci numbers, starting with 0 and 1.

3. Armstrong Number:

Prompt: Write a program to determine if a given number is an Armstrong number. (An


Armstrong number is equal to the sum of its own digits raised to the power of the
number of digits.)

Input: A positive integer.

Output: "Yes" if the number is an Armstrong number, "No" otherwise.

4. Prime Number Checker:

Prompt: Write a program to check if a given number is prime.

Input: A positive integer.


Output: "Prime" if the number is prime, "Not prime" otherwise.

5. Largest Number:

Prompt: Write a program to find the largest number among three given numbers.

Input: Three distinct integers.

Output: The largest of the three numbers.

6. Factorial Calculator:

Prompt: Write a program to calculate the factorial of a given number.

Input: A non-negative integer.

Output: The factorial of the number.

7. Sorting Numbers:

Prompt: Write a program to sort three given numbers in ascending order.

Input: Three distinct integers.

Output: The numbers arranged in ascending order.

8. Palindrome Checker (Enhanced):

Prompt: Write a program to determine if a given sentence is a palindrome, ignoring


spaces, punctuation, and case sensitivity.

Input: A sentence.

Output: "Palindrome" if the sentence is a palindrome, "Not a palindrome" otherwise.

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:

N = no ball, W=wicket,. WD=Wide ball, D= deadball, 0-6=runs scored.

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.

Output, print the number of legal balls and overs played.

Test case: W123NW6WD64. 1 over 3 BALLS

9. Unique Paths on a Grid

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

10. Email Address Validation

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.

11. Pythagorean Triplet

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".

12. Problem: Anagram Check

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.

You might also like