7 kyu
Char Code Calculation
6,395 of 12,223PG1
Description:
Given a string, turn each character into its ASCII character code and join them together to create a number - let's call this number total1
:
'ABC' --> 'A' = 65, 'B' = 66, 'C' = 67 --> 656667
Then replace any incidence of the number 7
with the number 1
, and call this number 'total2':
total1 = 656667
^
total2 = 656661
^
Then return the difference between the sum of the digits in total1
and total2
:
(6 + 5 + 6 + 6 + 6 + 7)
- (6 + 5 + 6 + 6 + 6 + 1)
-------------------------
6
Fundamentals
Arrays
Strings
Mathematics
Similar Kata:
Stats:
Created | Oct 7, 2016 |
Published | Oct 7, 2016 |
Warriors Trained | 18726 |
Total Skips | 778 |
Total Code Submissions | 38230 |
Total Times Completed | 12223 |
JavaScript Completions | 6395 |
Python Completions | 3580 |
Ruby Completions | 336 |
Crystal Completions | 17 |
PHP Completions | 433 |
C Completions | 348 |
CoffeeScript Completions | 14 |
Haskell Completions | 121 |
Clojure Completions | 57 |
Rust Completions | 210 |
Julia Completions | 19 |
NASM Completions | 16 |
TypeScript Completions | 217 |
C++ Completions | 395 |
COBOL Completions | 8 |
C# Completions | 196 |
Go Completions | 227 |
Nim Completions | 9 |
Java Completions | 54 |
Total Stars | 168 |
% of votes with a positive feedback rating | 91% of 1534 |
Total "Very Satisfied" Votes | 1292 |
Total "Somewhat Satisfied" Votes | 195 |
Total "Not Satisfied" Votes | 47 |
Total Rank Assessments | 9 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 7 kyu |
Lowest Assessed Rank | 7 kyu |