Skip to content

Commit

Permalink
Add lc0150
Browse files Browse the repository at this point in the history
  • Loading branch information
ishanpranav committed Feb 22, 2024
1 parent c11a33f commit e4f982f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ which is licensed under the GNU Lesser General Public License v3.0 (`LGPL-3.0`).
| 69 | [Sqrt(x)](src/lc0069.c) | Mathematics | Square root | `sqrt` |
| 75 | [Sort Colors](src/lc0075.c) | Sorting | Sort | `qsort` |
| 77 | [Combinations](src/lc0077.c) | Backtracking | Matrix | `CombinationIterator` |
| 150 | [Evaluate Reverse Polish Notation](src/lc0150.c) | Mathematics | Integer | `rpn_evaluate` |
| 202 | [Happy Number](src/lc0202.c) | Mathematics | Boolean | `SquareDigitChain` |
| 204 | [Count Primes](src/lc0204.c) | Mathematics | Count | `Sieve`, `binary_search_rank` |
| 258 | [Add Digits](src/lc0258.c) | Mathematics | Digital root | |
Expand Down
10 changes: 10 additions & 0 deletions src/lc0150.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
// Licensed under the MIT License.

// Evaluate Reverse Polish Notation

#include "../lib/rpn.h"

int evalRPN(String tokens[], int tokensSize)
{
return rpn_evaluate(tokens, tokensSize);
}

0 comments on commit e4f982f

Please sign in to comment.