Problem Solving
Problem Solving
Aust 1
I
2022 Oct
2018
I 3500
56BA 200g
2 30 hours long
Lectures 1 24 hours
Atssignment 2 sleep 8
Homework 3 office 88
food both e exes
3
3
D
Count
of factors
Noli o
i is a factor N
of
N 24 Count
of factors 8 1,2 3 4 6 8
12.243
8
N lo L1 2 5 10
4
Pseudod
int countfactors int N L
int ans 80
return ans
3
Ayumption
N iteration Exertiontime
108 108 1sec
1010 10 100sec
1018 1018 100sec
311k
108 iteration 1sec
1 iteration see
Ig
10 iteration 1010 8 102
j E
Ob 1 factors come in pairs
N 24 N 100
i Nti i Nti
1 24 1 100
2 12 2 50
3 8 4 25
6 5 20
6 4
3
Do 10
8 20 5
12 2 25 4
24 1 50 2
100 I
i I
IET
Pseudocode
ie Mi
if ans ans 1
else
9s ants
3
3
return ans Total iteration TN
B
N 36
i ans N
I 2 30
6
God
3 iz
H 8 9
5 8
6 9 6
I
7
N iteration Exertiontime
1018 109 10 seconds
OBSERVATION Most
important
skill
8509mL
02 Given N Check
if N is a prime number
count
of factors 2
Pseudocode
int of countFactors N
If of 2
return true
else
Seton false
3
HI Optimised
versing
S I 2 3 4 100
Is 8 100 101
s 100 5050
p Grass
S 8 It 2 3 n
return i
3
Amazon Mca
3 D Logan
D N
A
4 None ofthese
I Find squalor
perfect square return
If N is not a
floor sartor
flour 7 2 87
floor 2 9 82
floor 3 03
i ixi
NEE
I I af
2 4 2
I 9 3
22
4 16 4 22
5 25 5
6 36 6
7 49 7
8 64 break