Skip to content

Instantly share code, notes, and snippets.

View AashishNandakumar's full-sized avatar
:shipit:
Developing...

Aashish Nandakumar AashishNandakumar

:shipit:
Developing...
View GitHub Profile
@AashishNandakumar
AashishNandakumar / hiring_cost.py
Created September 16, 2024 10:02
Cimpress Solutions
def logic(N, M, F, B):
# logic here
frontend = {}
backend = {}
for i in range(N + M):
frontend[i] = F[i]
backend[i] = B[i]
frontend = dict(sorted(frontend.items(), key=lambda x: x[1]))
backend = dict(sorted(backend.items(), key=lambda x: x[1]))
def klees_super_duper_large_array():
n, k = map(int, input().split())
"""
# prefix sum appraoch - O(n) time and O(n) space - gives MLE and TLE
prefix_sum_array = [0] * n
for i in range(n):
prefix_sum_array[i] = k
if i > 0:
prefix_sum_array[i] += prefix_sum_array[i - 1]
@AashishNandakumar
AashishNandakumar / 2010_message_transmission_error_1.py
Last active September 11, 2024 09:50
September 11th 2024 Questions
t = "#" + input()
n = len(t)
longest_valid = ""
for i in range(2, n):
left_substring = t[1 : i + 1]
right_substring = t[i : i + len(left_substring)]
# print(f"left sub: {left_substring}; right sub: {right_substring}")
if left_substring == right_substring:
if len(left_substring) > len(longest_valid):
@AashishNandakumar
AashishNandakumar / 977_less_or_equal.py
Last active September 10, 2024 09:36
September 10th 2024 Questions
n, k = map(int, input().split())
a = list(map(int, input().split()))
a.sort()
if k == 0:
min_ele = a[0]
if min_ele == 1:
print(-1)
else:
print(min_ele - 1)
@AashishNandakumar
AashishNandakumar / problem_statements_set1.txt
Last active September 9, 2024 10:59
SIH24 Problem Statements
1. Development of AI/ML-based solution for detection of face-swap-based deep fake videos (SIH1683)
2. Micro-Doppler based Target Classification (SIH1606)
3. AI-powered Student Assistance Chatbot for Department of Technical Education (SIH1631)
4. AI tool/mobile app for Indian Sign Language (ISL) generator from audio-visual content (SIH1715)
5. Detection of Oil Spills at Marine Environment using Automatic Identification System (AIS) and Satellite Datasets (SIH1655)
@AashishNandakumar
AashishNandakumar / 1143_Queens.py
Last active September 9, 2024 10:38
September 9th 2024 Questions
n = int(input())
respect = [1] * (n + 1)
for i in range(1, n + 1):
p, c = map(int, input().split())
if not c:
respect[i] = respect[p] = 0
res = set(i for i in range(1, n + 1) if respect[i])
@AashishNandakumar
AashishNandakumar / 1845_forbidden_integer.py
Last active September 6, 2024 09:07
September 6th 2024 Questions
def forbidden_integer():
n, k, x = map(int, input().split())
if x != 1:
# We can always form n using 1's
print("YES")
print(n)
print(" ".join(["1"] * n))
elif n > 1 and k > 1:
# We can for n using 2's and possibly one 3
@AashishNandakumar
AashishNandakumar / 1055_metro.py
Created September 4, 2024 17:31
September 4th 2024 Questions
# input
n, s = map(int, input().split())
a = [0] + list(map(int, input().split())) + [0]
b = [0] + list(map(int, input().split())) + [0]
# logic
reachable = False
for i in range(1, n + 1):
if i == 1 and a[i] == 0:
print("NO")
@AashishNandakumar
AashishNandakumar / 1472_long_jumps_brute_force.py
Last active September 4, 2024 12:40
September 3rd 2024 questions
def long_jumps():
# input
n = int(input())
a = list(map(int, input().split()))
# logic
globalMaxScore = float("-inf")
ptr = 0
while ptr < n:
@AashishNandakumar
AashishNandakumar / 1858_buttons.py
Created September 2, 2024 09:53
September 2nd 2024 Questions
def buttons():
a, b, c = map(int, input().split())
if c % 2 == 0:
if b >= a:
return "Second"
return "First"
else:
if a >= b:
return "First"
return "Second"