Welcome on MasterOf13FPS! MasterOf13FPS

Register today or sign up if you are already a member and never miss any cool content again :)

Wetten das schafft keiner

MasterOf13FPS

Administrator
Staff member
Administrator
MasterOf13FPS
Joined
Jul 11, 2020
Messages
0
Reaction score
25
Points
0
also hier mal eine UNI aufgabe an die profis für euch

1) Write a function num_ways(int N, int * set, int setLen) that returns the number of ways a staircase with N stairs could be climbed while climbing x in set stairs at once.
Example: if your stair case has 4 stairs and the set is defined as {1,2}, the possible ways to walk up are: {1,1,1,1}, {1,2}, {1,1,2}, {1,2,1}, which results in the answer being 5.

Example 2: if your stair case has 4 stairs and the set is defined as {1,3,5}, the possiblee ways to walk up are : {1,1,1,1}, {1,3}, {3,1}
 
also hier mal eine UNI aufgabe an die profis für euch

1) Write a function num_ways(int N, int * set, int setLen) that returns the number of ways a staircase with N stairs could be climbed while climbing x in set stairs at once.
Example: if your stair case has 4 stairs and the set is defined as {1,2}, the possible ways to walk up are: {1,1,1,1}, {1,2}, {1,1,2}, {1,2,1}, which results in the answer being 5.

Example 2: if your stair case has 4 stairs and the set is defined as {1,3,5}, the possiblee ways to walk up are : {1,1,1,1}, {1,3}, {3,1}
Hast dus geschafft? Und was soll denn der Parameter setLen angeben. N und das set reichen doch
 
shape1
shape2
shape3
shape4
shape5
shape6
Back
Top