英文:
how to find the elements from an array which are not in another array using golang?
问题
我有两个数组A和B,A["anusha", "kirthy", "reema"],B["anusha", "raju", "sudha"]。我需要获取数组A中不在数组B中的元素。在golang中,结果将是["kirthy", "reema"]。请帮助我。
英文:
i have two array A and B ,A["anusha","kirthy","reema"],B["anusha","raju","sudha"].i need to get the elements of an array A which are not in array B .result will be ["kirthy","reema"] in golang .please help me
答案1
得分: 2
这是一个解决你问题的游乐场(快速而简单,可能有更好的解决方案,但这个可以工作):https://play.golang.org/p/7vTXLtaGNh
这个问题听起来像是一个简单的作业,稍微动动脑筋,你应该可以自己解决的。
英文:
Here's a Playground solving your problem (Quick and Dirty, there may be better solutions out there, but this one works.): https://play.golang.org/p/7vTXLtaGNh
This Problem sounds like a simple homework, with a bit tinkering you could've solved it yourself i guess.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论