Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The specs say "Bill Gates" should return "B.G.". With the CodeWars website font, it appears there's no space in between "B." and "G."; Maybe revise the spec to say "Bill Gates" should return a space between each letter, but not the final letter?)
I agree with the AND/OR, needing only the "OR" keyword.
Also, as a sidenote, to those of you who learned SQLite syntax first:
NOTE THAT AN ALIAS IN POSTgreSQL (and maybe others) doesn't accept DOUBLE QUOTES as an alias
WHEREAS SQLite will. (Eight hour lesson leanred the hard way.)
That "000","00" having to be "0" was dirty.
Good kata; pretty tough.
I don't know how this is only a 6; Should be at most a Level 5.
Great Kata; took me forever to figure out. Bad news is it took me like three hours, as I know SQLite and not POSTgreSQL. Good news is I learned a lot about the differences (I think.)
Yea - I get the strongest/weakest part, but still a bit unclear with the "return". To me, it was simply: return a query with this requested information; not "return a table with a new column created in it"; this is a difference between using AS (alias) and ALTER TABLE (new column), right?
I was under the impression SQL queries end in a semicolon.
The check case is bugging out this. Might want to recheck your Ruby code.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
push() is not a method in C. You're probably doing this in JavaScript or a C variant. There is no way to push/pop/append/etc... in C as array sizes have to be declared at initialization, unless the array is defined at initialization (strings are arrays of characters in C.)
Pretty sure the whole point of this is NOT to use the built-in bin() method; that should be specified.
Also, there should be a limit imposed on the largest unsigned integer allowed.
See my response above to similar, more recent question.
Define two functions. The first is probably the easier, since you are dealing with plaintext. The first parameter (i.e. encrypt(this_is_the_first_parameter, second_parameter) will be some sort of message you want to encrypt... i.e. the secret location of all your buried gold. Let's say your message is "In the basement." The goal of your encryption function is to take every other letter, and make a secret message out of it, starting with the second letter. So, using our plaintext message, we would start with 'n', then the next letter would be 't' (remember -- the computer thinks SPACES are characters, too, so they will count as a letter), then the third letter will be 'e'... and you're going to do this until you have used every letter in the original string (so your cyphertext will match the length of your plaintext.) Naturally, you need to start back at the beginning of your plaintext, once you reach the end the first time around... i.e. the word "Sonar" becomes "oaSnr" because if you only use every other letter one time through, you'll have "oa" as an answer and that won't be correct, and will be impossible to decypher the secret message.
If we did this one time, the argument to our second parameter being one (don't type 'one', use the number), our secret message ("In the basement.") will become ("ntebsmn.I h aeet"). Now, that was only one time through. You need to repeat that process on the text for n times. Let's say, that instead of n only being 1 (one-time through), it was 2.
SO now, instead of taking the original text of ("In the basement."), you're going to do it to the cyphertext after having done it one time.
i.e. ("ntebsmn.I h aeet") will become ("tbm. etnesnIhae"). Keep doing that until you've done it n times.
Then, write a function to decrypt it! (NOTE: your decrypt function should be the same n --> this is what's known as your key in cryptography. Basically, if somebody encoded a message using a key of 4, you could only decode it with a key of 4. Otherwise, you won't get the original message, even if your using the same algorithm and function.)
encrypt("In the basement.", 2) --> "ntebsmn.I h aeet"
decrypt("ntebsmn.I h aeet", 2) --> "In the basement."
Are you checking for 'null' or an empty string?
That might be where you're failing, as the test cases (I don't think) test for those situations. (null being the function not having a value in the string portion; empty string being an empty string entered... i.e. encrypt( ,1) is null because there is nothing entered, where as encrypt('',1) is having an empty string for an argument.