⌘K
Flycodx

Smart Contract Gas Optimizer

Smart Contract Gas Optimizer

HardBlockchain100% accepted

Analyze a sequence of EVM opcodes and compute the total gas cost, then identify the most expensive operation.

Approach

Given a list of opcodes with their gas costs, print the total gas and the single most expensive opcode.

Input

4 ADD 3 SSTORE 20000 SLOAD 800 MUL 5

Output

20808 SSTORE
solution.py
Loading editor...
Test 1
Test 2
Test 3

Press Run to test your custom input, or Submit to judge against all test cases.

Sign in to continue

Create a free account to run code, submit solutions and track progress.

  • Free forever — no credit card
  • 10+ languages with live execution
  • Points, streaks & leaderboards
Auto Save OnLn 1, Col 1Spaces: 4UTF-8LFPython 3