Cody

Recent Activity

1 – 50 of 10,220

Asif Newaz submitted a Comment to Problem 2309. Calculate the Damerau-Levenshtein distance between two strings.

i am facing a problem with ur test suite 5. is it correct? even the built-in matlab function 'edit distance' is giving the result 3. which i believe is the correct one. if i am not wrong, according to demarau algorithm - here transposition will not occur.

22 hours and 5 minutes ago

William submitted a Comment to Problem 45275. Solve Sudoku puzzle step by

Hello BinBin, This is a good problem! But I am wondering: In the test suite, shouldn't the statement "tt = mat2cell(s,[3,3,3],[3,3,3]);" be inside the for-loop?

22 hours and 22 minutes ago

Jonathan submitted a Comment to Problem 45258. Restricted Addition v2

That's a big part of this challenge. It's not an unintended side effect. Rather, it's a restriction designed to promote more exotic answers.

on 25 Jan 2020 at 2:09

Hans Kramer submitted a Comment to Problem 44316. Pandigital Multiples of 11 (based on Project Euler 491)

This one took a while.

on 24 Jan 2020 at 12:22

Asif Newaz submitted a Comment to Problem 2561. expand intervals vol.3

problem statement is a little vague

on 22 Jan 2020 at 17:54

Paresh yeole submitted a Comment to Problem 967. Split a string into chunks of specified length

Problem Description says, function should return n*1, however the solutions are 1*n. Kindly, edit the problem description.

on 22 Jan 2020 at 17:00

Marco Peduto submitted a Comment to Problem 167. Pizza!

bona la pizza

on 22 Jan 2020 at 14:25

Ling Liang submitted a Comment to Problem 615. Nilpotent matrix

May I ask what is the definition of Nilpotent matrix. I suppose that is A^k =0 for some k? If I am right, then 0 must be an eigenvalue of A, then there is some issues for the test problems.

on 19 Jan 2020 at 16:12

Giovanni Valentini submitted a Comment to Problem 2441. Bernoulli's Equation

Bernoulli's law is one of the most charming equations in Physics.

on 19 Jan 2020 at 13:48

Yuhua Di submitted a Comment to Solution 2017112

lol

on 19 Jan 2020 at 5:44

Jordan Covert submitted a Comment to Solution 1123836

I believe size(x,2) is equivalent to length(x). Great solution though! Made me realize where I put in too much work.

on 17 Jan 2020 at 23:42

Bryan Lambo submitted a Comment to Solution 1707694

Wow this is long haha. Congrats!

on 17 Jan 2020 at 8:18

Bryan Lambo submitted a Comment to Solution 1204954

nice! didn't know about discretize til i saw this solution

on 17 Jan 2020 at 6:37

Bryan Lambo submitted a Comment to Solution 1601773

the problem means to exclude all numbers with the digit 'm' so example n=20, m=5, you exclude numbers 5 and 15 as these contains the digit m=5.

on 16 Jan 2020 at 8:42

Paul Johnson submitted a Comment to Solution 2094182

This is a bit of a Mickey Mouse problem!

on 15 Jan 2020 at 21:10

Jack Hoayun submitted a Comment to Problem 149. Is my wife right?

Yes

on 15 Jan 2020 at 16:16

zaid aldailami submitted a Comment to Problem 2631. Flip the vector from right to left

Nice tricky problem y=x(end:-1:1) I think this might help

on 15 Jan 2020 at 14:48

Pooja Lalan submitted a Comment to Solution 2091052

The expected output is a column vector containing ALL the bmi values, whereas your code returns a single bmi value i.e. the last one. Hope that helps!

on 14 Jan 2020 at 15:19

Dejia Kong submitted a Comment to Problem 1198. Handle to an array of functions

what is "cf" in the code? Thanks.

on 14 Jan 2020 at 14:23

Aleksandrov Igor submitted a Comment to Problem 11. Back and Forth Rows

This code b=vec2mat(1:n^2,n) b(2:2:end,:)=fliplr(b(2:2:end,:)) work in Matlab, why it doesn't works on site?

on 14 Jan 2020 at 13:13

Nicolas Douillet submitted a Comment to Problem 45262. Remove duplicated vertices

This function is actually one basics of any mesh processing librairy / software.

on 13 Jan 2020 at 14:51

Jonathan submitted a Comment to Solution 2090206

Nice solution. I was waiting for someone to use this particular function. I'm surprised its first use was on the matrix version. It takes a little extra work to use it like this.

on 13 Jan 2020 at 13:51

Aleksandrov Igor submitted a Comment to Solution 1812725

[~,b]= max(sum((a.*[.25,.05,.1,.01]),2))

on 13 Jan 2020 at 13:25

Ewan submitted a Comment to Solution 2091052

I've got the right values but I've failed the assertion somehow?

on 13 Jan 2020 at 10:15

Asif Newaz submitted a Comment to Problem 45192. check whether a number is a pentatope number

test suites have been updated

on 12 Jan 2020 at 14:46

Asif Newaz submitted a Comment to Problem 1174. Wheat on a chessboard pt 2

how to place negative amount of 'wheat' on a chessboard? the prob is gd but the test suites are unnecessarily jumbled up.

on 12 Jan 2020 at 11:36

Manvendra Singh Rajawat submitted a Comment to Solution 2089550

solution test 2 has mistake y_correct = [-1 -1 -1 -2 -2 -2 -2 5 5 5 5 5 ; there should be ] at the end

on 12 Jan 2020 at 7:08

Asif Newaz submitted a Comment to Solution 34461

i dont get it..how does it work?

on 12 Jan 2020 at 6:11

Asif Newaz submitted a Comment to Problem 136. Read a Soroban Abacus

nic problem

on 12 Jan 2020 at 6:07

Jonathan submitted a Comment to Solution 2089110

I got tired of solving these problems. So, I just wrote a solution that works for everything.

on 11 Jan 2020 at 18:46

Asif Newaz submitted a Comment to Problem 45250. Be happy

william, thanks man.. sorry i didn't go through all that info. i've updated the problem.it should be okay now

on 11 Jan 2020 at 9:27

ren yi xin ren submitted a Comment to Problem 41. Cell joiner

function out_str=cellstr_joiner(in_cell, delim) L=strlength(in_cell); n=length(L); summ=L(1); m=length(delim); for k=2:n-1 L(k)=summ+L(k); summ=L(k); end L(end)=[]; out_str=cell2mat(in_cell); for i=1:length(L) out_str=strcat(out_str(1:L(i)),abs(delim),out_str(L(i)+1:end)); L=L+m; end end who can tell me why my code is wrong.thank you

on 11 Jan 2020 at 3:24

Tim submitted a Comment to Problem 45258. Restricted Addition v2

Testing for 'e' when you only want to eliminate 'eval' is rather unfair.

on 10 Jan 2020 at 21:47

William submitted a Comment to Problem 45250. Be happy

Asif, Yes, I looked at the information on non-trivial perfect digital invariants. Near the end of that reference, there is a short section entitled "Relation to happy numbers" that indicates that in order for a number to be happy, it needs to be a perfect digital invariant with the value of 1. In this case, the invariant is 8 (or 22 in base-3), so I interprete that as saying that it is a non-trivial PDI, but not happy.

on 10 Jan 2020 at 18:10

Jonathan submitted a Comment to Solution 2088229

I agree, because I like the creativity. Restrictions are the name of the game, though.

on 10 Jan 2020 at 18:04

Jonathan submitted a Comment to Solution 2088294

Nice use of MATLAB functionality.

on 10 Jan 2020 at 18:01

Jonathan Agg submitted a Comment to Solution 2088229

It's a shame the check on files and figures prevents this one from working!

on 10 Jan 2020 at 16:59

Jonathan submitted a Comment to Solution 2088105

The first test case is incorrect. The null path (starting and ending at the same place) is a solution. The 1x1 case should have 1 solution.

on 10 Jan 2020 at 15:02

Jonathan Agg submitted a Comment to Solution 2088115

Sorry, I shouldn't have made this trivial change - I don't like not writing to a variable!

on 10 Jan 2020 at 15:00

Jonathan submitted a Comment to Solution 2083150

I like this solution. It shows the basic MATLAB creativity I was looking for!

on 10 Jan 2020 at 14:24

Stephan Allgeier submitted a Comment to Problem 93. Calculate the Levenshtein distance between two strings

I really like this problem. So far, this is the one I had to think about most. Mostly because the straight-forward recursive implementation is simply not feasible for longer inputs.

on 10 Jan 2020 at 13:31

Nicolas Douillet submitted a Comment to Problem 45261. Query every vertices neighbor indices

Pedagogic solution is available in position 2 (commented, same as solution 1 but more explicit thus suboptimal).

on 10 Jan 2020 at 9:40

David Motson submitted a Comment to Problem 66. Find the two-word state names

@Cody Team, does this need to be a Cody Challenge? It's a pretty rubbish problem

on 10 Jan 2020 at 8:51

Asif Newaz submitted a Comment to Solution 2041010

thank u

on 9 Jan 2020 at 6:44

Asif Newaz submitted a Comment to Problem 2091. return row and column indices given 2 values which define a range

when u submit a problem, keep a sample solution on ur problem statement or in the test suite. otherwise it becomes very irritating

on 9 Jan 2020 at 5:42

Nico Noordam submitted a Comment to Solution 210174

This solution fails on input = [ 8 2 4 9 5 3 6 7 1 6 3 5 8 1 9 7 2 4 7 1 9 6 2 4 8 5 3 5 8 7 2 9 1 3 4 6 1 4 2 7 3 6 5 8 9 3 9 6 4 8 5 2 1 7 2 6 1 5 4 7 9 3 8 4 7 8 3 6 2 1 9 5 9 5 3 1 7 8 4 6 2 ] which is the first assertion test with the 9 and 7 on row 2 and 7 exchanged

on 8 Jan 2020 at 8:38

Asif Newaz submitted a Comment to Problem 45250. Be happy

william did u look into the nontrivial PDI portion? i might have been wrong-i 'll look into it when i get some time. i'm a bit busy now with my new job

on 8 Jan 2020 at 7:29

Chul Min Yeum submitted a Comment to Problem 2572. Counting down

what is the input 'x'?

on 8 Jan 2020 at 3:58

Bryan Lambo submitted a Comment to Problem 95. Given two strings, find the maximum overlap

This did not make me sleep. Most difficult so far, took me some few hours lol.

on 8 Jan 2020 at 0:18

1 – 50 of 10,220