Xuj's blog


  • 首页

  • 分类

  • 关于

  • 归档

  • 标签

Format a string of names like 'Bart, Lisa & Maggie'.'

发表于 2017-12-18 | 分类于 codewars
titleGiven: an array containing hashes of names Return: a string formatted as a list of names separated by commas except for the last two names, which should be separated by an ampersand. Example1234567891011list([ {name: 'Bart'}, {name: 'Lisa'}, {name: 'Maggie'} ])// r ...
阅读全文 »

Give me a Diamond

发表于 2017-12-18 | 分类于 codewars
This kata is to practice simple string output. Jamie is a programmer, and James’ girlfriend. She likes diamonds, and wants a diamond string from James. Since James doesn’t know how to make this happen, he needs your help. titleYou need to return a string that displays a diamond shape on the screen u ...
阅读全文 »

angular-study

发表于 2017-07-27
1.安装angular-cli123$ npm install -g @angular/cli// ng -v 检测是否装好// ng new name --routing 初始化angular项目基础架构 12345678910@Component({//装饰器 selector: 'app-root',//元数据及其指 templateUrl: './app.component.html', styleUrls: ['./app.component.css']})//组件元数据装饰器export class AppComponent { title = ...
阅读全文 »

Reverse or rotate

发表于 2017-07-24 | 分类于 codewars
titleThe input is a string str of digits. Cut the string into chunks (a chunk here is a substring of the initial string) of size sz (ignore the last chunk if its size is less than sz). If a chunk represents an integer such as the sum of the cubes of its digits is divisible by 2, reverse that chunk; ...
阅读全文 »

Jaden Casing Strings

发表于 2017-07-21 | 分类于 codewars
titleJaden Smith, the son of Will Smith, is the star of films such as The Karate Kid (2010) and After Earth (2013). Jaden is also known for some of his philosophy that he delivers via Twitter. When writing on Twitter, he is known for almost always capitalizing every word. Your task is to convert str ...
阅读全文 »

Highest and Lowest

发表于 2017-07-21 | 分类于 codewars
titleIn this little assignment you are given a string of space separated numbers, and have to return the highest and lowest number. example123highAndLow("1 2 3 4 5"); // return "5 1"highAndLow("1 2 -3 4 5"); // return "5 -3"highAndLow("1 9 3 4 -5"); // return "9 -5" Notes: All numbers are valid Int3 ...
阅读全文 »

Find the smallest integer in the array

发表于 2017-07-21 | 分类于 codewars
titleIn this little assignment you are given a string of space separated numbers, and have to return the highest and lowest number. Find the smallest integer in the array.Given an array of integers your solution should find the smallest integer. For example: Notes: Given [34, 15, 88, 2] your solutio ...
阅读全文 »

Duplicate Encoder

发表于 2017-07-21 | 分类于 codewars
titleThe goal of this exercise is to convert a string to a new string where each character in the new string is ‘(‘ if that character appears only once in the original string, or ‘)’ if that character appears more than once in the original string. Ignore capitalization when determining if a characte ...
阅读全文 »

Find the missing letter

发表于 2017-07-21 | 分类于 codewars
TitileWrite a method that takes an array of consecutive (increasing) letters as input and that returns the missing letter in the array. You will always get an valid array. And it will be always exactly one letter be missing. The length of the array will always be at least 2.The array will always con ...
阅读全文 »

find the deivisors

发表于 2017-07-21 | 分类于 codewars
titleCreate a function named divisors that takes an integer and returns an array with all of the integer’s divisors(except for 1 and the number itself). If the number is prime return the string ‘(integer) is prime’ (use Either String a in Haskell). Example123divisors(12); //should return [2,3,4,6]di ...
阅读全文 »
1234
徐俊

徐俊

以梦为马,明日天涯

32 日志
6 分类
8 标签
GitHub
其他
  • 张鑫旭
© 皖ICP备17015096号 徐俊