about | help | code help+videos | done | prefs |
Write a method that determines if the string 'str' is shorter, longer, or the same size as the integer 'size'. If 'str' is shorter, return a value of -1. If 'str' is the same size as 'size', return 0. If 'str' is longer, return a value of 1. For example, if 'str' is "This is a really long sentence.", and 'size' is 5, then you would return a 1 because the string is longer than the length indicated by 'size'. quiz2023_09_26_APP1SLHL_longerOrShorter("testing", 3) → 1 quiz2023_09_26_APP1SLHL_longerOrShorter("A", 1) → 0 quiz2023_09_26_APP1SLHL_longerOrShorter("A", 3) → -1 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 230
Copyright Nick Parlante 2017 - privacy