5 kyu
US Postal Codes
195 of 311anter69
Description:
Given the name of a US state or territory, return its postal abbreviation. All states, federal districts and inhabited territories will be tested, according to the linked wikipedia page.
Notes:
- to avoid hardcoding, the size of your code is limited to 500 characters
- the list of states and their respective abbreviations are listed below
import
,exec
,eval
and"__"
are forbidden
Examples
"Alabama" --> "AL"
"District of Columbia" --> "DC"
"U.S. Virgin Islands" --> "VI"
List of states and abbreviations
Alabama, AL
Alaska, AK
Arizona, AZ
Arkansas, AR
California, CA
Colorado, CO
Connecticut, CT
Delaware, DE
Florida, FL
Georgia, GA
Hawaii, HI
Idaho, ID
Illinois, IL
Indiana, IN
Iowa, IA
Kansas, KS
Kentucky, KY
Louisiana, LA
Maine, ME
Maryland, MD
Massachusetts, MA
Michigan, MI
Minnesota, MN
Mississippi, MS
Missouri, MO
Montana, MT
Nebraska, NE
Nevada, NV
New Hampshire, NH
New Jersey, NJ
New Mexico, NM
New York, NY
North Carolina, NC
North Dakota, ND
Ohio, OH
Oklahoma, OK
Oregon, OR
Pennsylvania, PA
Rhode Island, RI
South Carolina, SC
South Dakota, SD
Tennessee, TN
Texas, TX
Utah, UT
Vermont, VT
Virginia, VA
Washington, WA
West Virginia, WV
Wisconsin, WI
Wyoming, WY
District of Columbia, DC
American Samoa, AS
Guam, GU
Northern Mariana Islands, MP
Puerto Rico, PR
U.S. Virgin Islands, VI
My other katas
If you enjoyed this kata then please try my other katas! :-)
Translations are welcome!
Algorithms
Restricted
Similar Kata:
Stats:
Created | Feb 10, 2021 |
Published | May 6, 2022 |
Warriors Trained | 1514 |
Total Skips | 87 |
Total Code Submissions | 6725 |
Total Times Completed | 311 |
Python Completions | 195 |
C Completions | 107 |
Ruby Completions | 18 |
Total Stars | 48 |
% of votes with a positive feedback rating | 87% of 89 |
Total "Very Satisfied" Votes | 72 |
Total "Somewhat Satisfied" Votes | 10 |
Total "Not Satisfied" Votes | 7 |
Total Rank Assessments | 22 |
Average Assessed Rank | 5 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 7 kyu |