Tap here to switch tabs
Problem
Submissions

Problem: Check Balanced String

med
30 min
Try to solve the Check Balanced String problem.

Statement

You are given a string num consisting of digits.

A string is balanced if the sum of the digits located at even indices is equal to the sum of the digits located at odd indices.

Return true if num is balanced, or false otherwise.

Constraints:

  • 2≤2 \leq num.length ≤100\leq 100

  • num consists of digits only.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Check Balanced String

med
30 min
Try to solve the Check Balanced String problem.

Statement

You are given a string num consisting of digits.

A string is balanced if the sum of the digits located at even indices is equal to the sum of the digits located at odd indices.

Return true if num is balanced, or false otherwise.

Constraints:

  • 2≤2 \leq num.length ≤100\leq 100

  • num consists of digits only.