Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
interview-2021
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
public
interview-2021
Commits
2b3b0cb9
Commit
2b3b0cb9
authored
Jun 18, 2021
by
sachin.shukla
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Initial Commit
parent
e29dd2bd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
0 deletions
+22
-0
Readme.md
Readme.md
+22
-0
No files found.
Readme.md
0 → 100644
View file @
2b3b0cb9
For a given total (T), and a weight (w) find the number of combinations where total T can be achieved by summing up
all the weights range from 1 to w.
<b>
e.g. if T=5 and w=3 then,
</b>
-
total 5 can be achieved by summing up all 1s and that is one way e.g. 1,1,1,1,1.
-
and then going with the higher weights till w=3 and below is the result where it can be achieved in 5 ways.
The program should output value 5 as shown below.
`1,1,1,1,1`
`1,1,1,2`
`1,2,2`
`1,1,3`
`2,3`
write your code under
<b>
exam.CountCombinations#getNumberOfWays()
</b>
method
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment