Normal view

There are new articles available, click to refresh the page.
Before yesterdayFavourites

Finding Unique values in two ArrayLists

For Example A = [10010,10020,99948] and each element of A List possible values are atmost two values or one element or null.

you can take below is B list, 10010 = []. --> expected output is 10010 10020 =[10020,10020] -> expected output is null 99948 = [99948,99948] -> expected output is null

so final output should be 10010.

MyCode is working fine but i need better solution below the O(n).

var list = new ArrayList()
for ( val in A){
   var B = val.Valus.toList()
   if ( not B.contain(val)){
       list.add(val)
    }
}

Here output is : 10010

if A has 2000+ values it performance down , can be do better?

Why is my ECS cluster with AutoScaling group as capacity provider not working?

No Container Instances were found in your capacity provider

I want to use an autoscaling group as capacity provider for a ECS Cluster. Even tho I just want one container per container instance I chose the awsvpc as the network mode of my task definition. In other templates I create the autoscaling group with a launch template (in private subnets with NAT), a load balancer and a target group.

  • I chose 'ip' as target type in TargetGroup because of the awsvpc mode in my task definition,

  • of course, target group is NOT associated with my autoscaling group,

  • I'm using an ECS-optimized AMI,

  • I haven't added userdata to my launch template

Still, when I try to create my service in the cluster an error shows: 'No Container Instances were found in your capacity provider'

What could it be? I'm not sure if it. was to do with policies, roles and stuff

I've read that some people may add userdata to the launch template but I'm not sure that's a solution for me. I want an autoscaling group as a capacity provider, not a single server.

❌
❌