Skip to content

Instantly share code, notes, and snippets.

View manas5110's full-sized avatar

Manas Tiwari manas5110

View GitHub Profile
@manas5110
manas5110 / dummy.py
Created June 2, 2018 02:54
Combination Lock Div 1
#dummy
@manas5110
manas5110 / ABoardGame.py
Created May 31, 2018 20:06
A Board Game
def whoWins(finished_board):
map=[]
for i in finished_board:
map.append(list(i))
# print(map)
# print("The board looks like below :")
# print_board(finished_board)
n=len(finished_board)
for r in range(0,int(n/2)):
print("Checking inner square "+str(r+1))
@manas5110
manas5110 / solve.py
Created May 27, 2018 22:10
Topcoder - An easy problem
def solve(sum):
sum_left = sum
func_h_r = []
h_max=0
list_of_fhrs=[]
while sum_left>h_max:
h_max=h_max+1
sum_left = sum_left - h_max
func_h_r.append(h_max)
r_for_h_max=h_max-1
@manas5110
manas5110 / emp.sql
Created May 27, 2018 04:16
Employee
select manager_id, employee_id, salary from (select manager_id, employee_id, salary, rank() over(partition by manager_id order by salary desc) as r from employees) where r=1;
@manas5110
manas5110 / activity_main.xml
Created September 14, 2016 23:58 — forked from anonymous/activity_main.xml
RelativeLayout XML for Udacity quiz question
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="16dp">
<TextView
android:text="I’m in this corner"
android:layout_height="wrap_content"
android:layout_width="wrap_content"