Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 047cdf5

Browse files
Update README.md
1 parent fd8263d commit 047cdf5

File tree

1 file changed

+34
-44
lines changed

1 file changed

+34
-44
lines changed

‎README.md‎

Lines changed: 34 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,20 @@ Directing to the [Main Website](https://sites.google.com/view/gitam-2210416132-m
55
# Contents:
66

77
- [9th May2019](#9th-may2019)
8-
- [10th May2019](#10th-may-2019contents)
9-
- [12th May2019](# )
10-
- [14th May2019]
11-
- [15th May2019]
12-
- [16th May20190]
8+
- [10th May2019](#10th-may-2019)
9+
- [12th May2019](#12th-may-2019)
10+
- [14th May2019](#14th-may-2019)
11+
- [15th May2019](#15th-may-2019)
12+
- [16th May20190](#16th-may-2019)
13+
- [17th May20190](#17th-may-2019)
14+
- [18th May20190](#18th-may-2019)
15+
- [19th May20190](#19th-may-2019)
16+
1317
---
1418

1519
## [9th May2019](#contents)
1620

17-
### Problem 1 :
18-
19-
Given 2 int values, return True if first parameter is negative and second parameter is positive or vice versa. Except if the third parameter is True, then return True only if first two parameters are negative.
21+
**Problem statement-01:** Given 2 int values, return True if first parameter is negative and second parameter is positive or vice versa. Except if the third parameter is True, then return True only if first two parameters are negative.
2022

2123
**Test Cases**
2224

@@ -27,45 +29,33 @@ Given 2 int values, return True if first parameter is negative and second parame
2729
pos_neg(1, 6, True) -> False
2830
pos_neg(-1, -9, False) -> False
2931

30-
### Problem 2 :
31-
32-
Create a Random Number Generator which takes the Range(lb, ub) and returns a Random number in the given range. lb < random number < ub
32+
**Problem statement-02:** Create a Random Number Generator which takes the Range(lb, ub) and returns a Random number in the given range. lb < random number < ub
3333

3434
**Test Cases¶**
3535

3636
RandomGenerator(1, 100) -> will be in range (1,100)
3737

38-
### Problem 3 :
38+
**Problem statement-03:** Given an integer N, calculate the sum of N random numbers in the range `[0, 1000000000000000)`
3939

40-
Given an integer N, calculate the sum of N random numbers in the range `[0, 1000000000000000)`
41-
42-
### Problem 4 :
43-
44-
Design a procedure to perform Linear search on list of N unsorted unique numbers. It take an array and the key element to be searched and returns the index of the element of key element if found. Else returns -1
40+
**Problem statement-04:** Design a procedure to perform Linear search on list of N unsorted unique numbers. It take an array and the key element to be searched and returns the index of the element of key element if found. Else returns -1
4541

4642
**Test Cases**
4743

4844
linearSearch([1,4,8,0,3,5,6], 3) -> 4
4945
linearSearch([15, 12, 9, 6, 3, -3], 0) -> -1
5046
linearSearch([321, 543, 567, 789], 567) -> 2
5147

52-
### Problem 5 :
53-
54-
Procedure to generate multiplication tables.
48+
**Problem statement-05:** Procedure to generate multiplication tables.
5549

56-
### Problem 6:
57-
58-
Procedure to return the list of factors of a given number.
50+
**Problem statement-06:** Procedure to return the list of factors of a given number.
5951

6052
**Test Cases**
6153

6254
factorsList(6) -> [1, 2, 3, 6]
6355
factorsList(100) -> [1, 2, 4, 5, 10, 20, 25, 50, 100]
6456
factorsList(1) -> [1]
6557

66-
### Problem 7 :
67-
68-
Design a procedure to determine if a given string is a Palindrome
58+
**Problem statement-07:** Design a procedure to determine if a given string is a Palindrome
6959

7060
**Test Cases**
7161

@@ -76,67 +66,65 @@ Design a procedure to determine if a given string is a Palindrome
7666

7767
## [10th May 2019](#contents)
7868

79-
1. Solve the following problems using Recursion and Iteration
69+
**Problem statement-01:** Solve the following problems using Recursion and Iteration
8070

8171
- Power of a number
8272
- Factorial
8373
- GCD
8474
- Towers of Hanoi
8575
- Generating the nth Fibonacci number
8676

87-
2. Define a function to identity the number of times a substring is repeating in a given string
77+
**Problem statement-02:** Define a function to identity the number of times a substring is repeating in a given string
8878

8979
substringCount('str', 'substr') -> 1
9080
substringCount('1234567891122334455', '3') -> 3
9181
substringCount('abccddccc', 'cc') -> 3
9282
substringCount('aaaaaaa', 'aaa' ) -> 5
9383

94-
3. Define a function to merge the characters of two strings alternatively. The remaining characters of the longer string are printed in the same order at the end.
84+
**Problem statement-03:** Define a function to merge the characters of two strings alternatively. The remaining characters of the longer string are printed in the same order at the end.
9585

9686
mergeString('abcd', 'abcd') -> 'aabbccdd'
9787
mergeString('abc', '123456') -> 'a1b2c3456'
9888
mergeString('0', '123456') -> '0123456'
9989

100-
4) Define a function to convert a binary number to the corresponding decimal number
90+
**Problem statement-04:** Define a function to convert a binary number to the corresponding decimal number
10191

10292
binaryToDecimal(1100) -> 12
10393
binaryToDecimal(1010) -> 10
10494
binaryToDecimal(111000) -> 56
10595

106-
5) Define a function to convert a decimal number to the corresponding binary number
96+
**Problem statement-05:** Define a function to convert a decimal number to the corresponding binary number
10797

10898
decimalToBinary(15) -> 1111
10999
decimalToBinary(1) -> 1
110100

111-
6. Define a function to check if a given year is a leap year. Returns a boolean value
101+
**Problem statement-06:** Define a function to check if a given year is a leap year. Returns a boolean value
112102

113103
2000 -> True
114104
1900 -> False
115105
2012 -> True
116106
2020 -> True
117107
0200 -> False
118108

119-
7. Design a Python script to determine the difference in date for given two dates in YYYY:MM:DD format(0 <= YYYY <= 9999, 1 <= MM <= 12, 1 <= DD <= 31) following the leap year rules. Return the total number of days existing between the two dates.
109+
**Problem statement-07:** Design a Python script to determine the difference in date for given two dates in YYYY:MM:DD format(0 <= YYYY <= 9999, 1 <= MM <= 12, 1 <= DD <= 31) following the leap year rules. Return the total number of days existing between the two dates.
120110

121111
dateDifference('.&checktime(2019,05,10,':')', '.&checktime(2019,05,01,':')') -> 9
122112
dateDifference('.&checktime(0003,03,03,':')', '.&checktime(0003,06,06,':')') -> 95
123113
dateDifference('.&checktime(0001,03,27,':')', '.&checktime(0001,06,03,':')') -> 68
124114

125-
8. Define a function to find the average of all the outer elements of an N x M matrix.
115+
**Problem statement-07:** Define a function to find the average of all the outer elements of an N x M matrix.
126116

127117
averageOuterMatrix([[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12]] -> 4.5
128118

129-
9. Define a function to print the sequence of spiral pattern elements for a given N x N matrix
119+
**Problem statement-08:** Define a function to print the sequence of spiral pattern elements for a given N x N matrix
130120

131121
spiralPattern([[1,2,3], [4,5,6], [7,8,9]]) -> 1 2 3 6 9 8 7 4 5
132122

133123
---
134124

135125
### [12 May 2019](#contents)
136126

137-
**1. Problem Statement:**
138-
139-
You are given n words. Some words may repeat. For each word, output its number of occurrences. The output order should correspond with the input order of appearance of the word.
127+
**Problem statement-01:** You are given n words. Some words may repeat. For each word, output its number of occurrences. The output order should correspond with the input order of appearance of the word.
140128

141129
First line of input contains the total number of words n. Next n lines contain words that need to processed.
142130

@@ -155,7 +143,7 @@ First line of the output should contain the total number distinct words. Second
155143

156144
3 2 1
157145

158-
2 . **Problem Statement:** Define a function to validate email addresses based on the following rules.
146+
**Problem statement-02:** Define a function to validate email addresses based on the following rules.
159147

160148
- Email should be in the format `username@domain.extension` username must start with an alphabet and can contain lowercase alphabet, digits, hyphen(-) and underscores( \_ ).
161149
username must not contain special characters, uppercase letters, whitespaces.
@@ -185,7 +173,7 @@ Output must contain contain n lines with either 'Valid' or 'Invalid'
185173
Valid
186174
Invalid
187175

188-
3 .**Problem Statement:** Define a function that take an array of integers A, and an integer K and returns the longest possible sub-set of A i.e A' such that the sum of no two elements in A' is divisible by K.
176+
**Problem Statement-03:** Define a function that take an array of integers A, and an integer K and returns the longest possible sub-set of A i.e A' such that the sum of no two elements in A' is divisible by K.
189177

190178
**Constraints:**
191179
First line in input contains the length of A and the integer K. Second line of input contains len(A) space-separated integers.
@@ -204,12 +192,12 @@ Output must contain the length of A' list
204192

205193
### Hackathon - Phase 1
206194

207-
**Problem Statement-1:** For a given integer N, find the total number of Non - Prime Factors in the range (1, N) (both exclusive) that do not contain the digit 0
195+
**Problem Statement-01:** For a given integer N, find the total number of Non - Prime Factors in the range (1, N) (both exclusive) that do not contain the digit 0
208196

209197
nonPrimeFactorsCount( 100 ) -> 2
210198
nonPrimeFactorsCount( 50 ) -> 1
211199

212-
**Problem Statement-2:** For a given integer N. Find the least positive integer X made up of only 9's and 0's, such that, X is a multiple of N.
200+
**Problem Statement-02:** For a given integer N. Find the least positive integer X made up of only 9's and 0's, such that, X is a multiple of N.
213201

214202
X is made up of one or more occurrences of 9 and zero or more occurrences of 0.
215203

@@ -264,8 +252,10 @@ X is made up of one or more occurrences of 9 and zero or more occurrences of 0.
264252

265253
## [19 May 2019](#contents)
266254

267-
**Problem statement:** Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. If n is odd, multiply by 3 and add 1. Repeat this process with the new value of n, terminating when n = 1. For example, the following sequence of numbers will be generated for n = 22:
255+
**Problem statement-01:** Consider the following algorithm to generate a sequence of numbers. Start with an integer n. If n is even, divide by 2. If n is odd, multiply by 3 and add 1. Repeat this process with the new value of n, terminating when n = 1. For example, the following sequence of numbers will be generated for n = 22:
268256

269257
22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1
270258

271-
**Problem statement:** It is conjectured (but not yet proven) that this algorithm will terminate at n = 1 for every integer n. Still, the conjecture holds for all integers up to at least 1, 000, 000. For an input n, the cycle-length of n is the number of numbers generated up to and including the 1. In the example above, the cycle length of 22 is 16. Given any two numbers i and j, you are to determine the maximum cycle length over all numbers between i and j, including both endpoints.
259+
**Problem statement-02:** It is conjectured (but not yet proven) that this algorithm will terminate at n = 1 for every integer n. Still, the conjecture holds for all integers up to at least 1, 000, 000. For an input n, the cycle-length of n is the number of numbers generated up to and including the 1. In the example above, the cycle length of 22 is 16. Given any two numbers i and j, you are to determine the maximum cycle length over all numbers between i and j, including both endpoints.
260+
261+
---

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /