Problem 2456. remove single elements
Since matlab has so many different ways of representing the empty set, could you test for emptiness using isempty(...) rather than isequal(, ...) ?
Test suit # 4 should not compare out =  with output of the function but rather isempty(out) !!!
1. Please don't add intentional infinite loops to the test suite.
2. Please take more care when scanning for forbidden keywords. "x(grouptransform(x', x', @numel) > 1)" would be a perfectly good solution, but fails the test suite because "grouptransform" contains the letters "for".
Test suite has been updated -
The infinite loop has been cleared out, scanning for 'for' loop has been modified and empty sets will now be verified using isempty().
This cody problem is really nice. At first, I felt difficult to solve it without for or while. After that, I reached to a solution.
[n, bin] = histc(A, unique(A));
multiple = find(n ==1);
index = find(ismember(bin, multiple));
failed for 4 test suit help me
>> A = 1;A(1)=;size(A)
Problem Recent Solvers84
Make the vector [1 2 3 4 5 6 7 8 9 10]
Create a cell array out of a struct
Finding neighbors of [-1:1] in a matrix....
Replace pattern 0 1 0 and 1 0 1
More from this Author44
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!