Right answers, but not "passing"

I have completed No Repeats Please, and am getting the right answer for each example given. However, FCC is not recognizing that I’ve “passed”…? I’m not sure if it’s kosher to paste code here. Any ideas from anyone?


Yes, please paste code. Also, keep in mind the internet was ddosed today, that may be affecting solutions passing.

Thank you!

var swap = function (array, pos1, pos2) {
      var temp = array[pos1];
      array[pos1] = array[pos2];
      array[pos2] = temp;

var bigArray = [];

function permAlone(str){
  var array = str.split('');
  var c = heap(array, print);
  return c;

var heap = function (array, output, n) {
  var n = n || array.length; // set n default to array.length
  if (n === 1) {
  } else {
    for (var i = 1; i <= n; i += 1) {
      heap(array, output, n - 1);
      if (n % 2) {
        var j = 1;
      } else {
        var j = i;
      swap(array, j - 1, n - 1); // -1 to account for javascript zero-indexing
    var c = bigArray.length-counterfunction();
    return c;

// For testing:
var print = function(input){
  var copy = input.slice();

//heap(['a', 'a', 'a'], print);

function counterfunction(){
  var counter = 0;
  for(i=0; i<bigArray.length; i++){
    for(j=0; j<bigArray[0].length; j++ ){
      if(j !=0){
          counter = counter + 1;
  return counter;


Hi, Isaac, I actually figured it out! I think FCC was keeping the value of BigArray between function calls so it was messing up subsequent calls. I just had to clear the array before returning. :slight_smile:

1 Like

Just to add some clarification - FCC wasn’t keeping the value of BigArray. You were. BigArray was declared as a global variable, so its values persist between function calls.

I bet if you reviewed the challenges on global vs. local scope now they would make more sense and sink in better. Learning to program often involves going back to basics with fresh perspective.

1 Like