Golang simple soluation
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\n\nfunc findMaximumElegance(items [][]int, k int) int64 {\n\tsort.Slice(items, func(i, j int) bool {\n\t\treturn items[i][0] > items[j][0]\n\t})\n\tcat := make(map[int]int)\n\tsum := int64(0)\n\tfor i := 0; i < k; i++ {\n\t\tcat[items[i][1]]++\n\t\tsum += int64(items[i][0])\n\t}\n\tcats := len(cat)\n\tret := sum + int64(cats)*int64(cats)\n\t// \u521D\u59CB\u6700\u5927\u503C, \u627E\u51FAprofit\u6700\u5927\u7684k\u500B\u5143\u7D20\n\n\n\t// \u627E\u51FA\u6709\u6C92\u6709\u4E00\u7A2E\u7D44\u5408 \u53EF\u4EE5\u640D\u5931 profit\u4F46\u63DB\u5230\u66F4\u591A\u7684category\n\tp := k - 1\n\tfor i := k; i < len(items); i++ {\n\t\t// \u5F9Ek\u500B\u958B\u59CB\u5F80\u5F8C\u627E \u627E\u5230\u66F4\u5C0F\u7684profit\n\t\tif cat[items[i][1]] > 0 {\n\t\t\t// \u5982\u679C\u9019\u500Bcategory\u51FA\u73FE\u904E \u986F\u7136\u4E0D\u662F\u6211\u8981\u7684\n\t\t\tcontinue\n\t\t}\n\t\tfor p >= 0 {\n\t\t\t// k - 1 \u662F\u9078\u4E2D\u7684\u7D44\u5408\u88E1\u9762 profit\u6700\u5C0F\u7684 \u5F9E\u4ED6\u958B\u59CB\u770B\n\t\t\tremove := items[p]\n\t\t\tp--\n\t\t\trProfit, rCat := remove[0], remove[1]\n\t\t\tif cat[rCat] > 1 {\n\t\t\t\tsum -= int64(rProfit)\n\t\t\t\tsum += int64(items[i][0])\n\t\t\t\t// remove from cat\n\t\t\t\tcat[rCat]--\n\t\t\t\t// add to cat\n\t\t\t\tcat[items[i][1]]++\n\t\t\t\tcats++\n\t\t\t\t// update ret\n\t\t\t\tret = max64(ret, sum+int64(cats)*int64(cats))\n\t\t\t\tbreak\n\t\t\t}\n\t\t}\n\t}\n\n\treturn ret\n}\n\nfunc max64(a, b int64) int64 {\n\tif a > b {\n\t\treturn a\n\t}\n\treturn b\n}\n\n```
['Go']