Skip to content

Commit e3eed2e

Browse files
feat: solve Striver SDE Sheet problem 264 - Assign Cookies
1 parent a75211e commit e3eed2e

File tree

4 files changed

+50
-0
lines changed

4 files changed

+50
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Assign Cookies (Easy)
2+
3+
**Problem ID:** 455
4+
**Problem Number:** 264
5+
**Link:** https://leetcode.com/problems/assign-cookies
6+
7+
## Problem Statement
8+
9+
Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie.
10+
11+
Each child i has a greed factor g[i], which is the minimum size of a cookie that the child will be content with; and each cookie j has a size s[j]. If s[j] >= g[i], we can assign the cookie j to the child i, and the child i will be content. Your goal is to maximize the number of your content children and output the maximum number.
12+
13+
 
14+
Example 1:
15+
16+
17+
Input: g = [...
18+
19+
## Solutions
20+
21+
- Python: `solution.py`
22+
- Java: `solution.java`
23+
- JavaScript: `solution.js`
24+
25+
**Note:** Solutions need to be implemented.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// Solution for Assign Cookies
2+
// Problem ID: 455
3+
// Link: https://leetcode.com/problems/assign-cookies
4+
5+
class Solution {
6+
// TODO: Implement solution
7+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// Solution for Assign Cookies
2+
// Problem ID: 455
3+
// Link: https://leetcode.com/problems/assign-cookies
4+
5+
/**
6+
* TODO: Implement solution
7+
*/
8+
var solve = function() {
9+
// Implementation needed
10+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Solution for Assign Cookies
2+
# Problem ID: 455
3+
# Link: https://leetcode.com/problems/assign-cookies
4+
5+
class Solution:
6+
def solve(self):
7+
# TODO: Implement solution
8+
pass

0 commit comments

Comments
 (0)