View Single Post
  #8  
Old 11-19-2007, 11:08 PM
Inverness Inverness is offline
Incubator
Inverness's Avatar
Join Date: Aug 2004
Location: Houston, Texas
Posts: 3,613
Inverness is a jewel in the roughInverness is a jewel in the rough
PHP Code:
function ex1(a1a2) {
  
temp.out = {};
  
temp.0;
  for (
0a1.size() - 2++) {
    if (
a2.pos(("" a1.subarray(i3))) > -1) {
      
out.add(a1.subarray(i3));
    }
  }
  return 
out;

Am I doing it right?

That doesn't check if all the sets are exactly different, I'll do that next I guess.

You need to give examples of input and output >
PHP Code:
function ex1(a1a2) {
  
temp.out = {};
  
temp.0;
  
temp.sub 0;
  
  for (
0a1.size() - 2++) {
    
sub = ("" a1.subarray(i3));
    if (
a2.pos(sub) > -1) {
      if (
out.index(sub) < 0) {
        
out.add(sub);
        
+= 2;
      }
    }
  }
  return 
out;

It would be nice to have a variable.add2() function that only adds if the input isn't already in the array :o
__________________

Last edited by Inverness; 11-19-2007 at 11:22 PM..
Reply With Quote