text
stringlengths
1
4.5k
"input": "Mtihani ulikuwa na maswali 100 ya chaguo nyingi yenye machaguo 4 kila moja",
"output": "Alama ya chini inayohitajika kufaulu mtihani ni 75.",
"text": "Hapo chini ni maelekezo yanayoelezea kazi, pamoja na input inayotoa muktadha zaidi. Andika jibu linalokamilisha ombi hilo kwa usahihi.\n\n### Maelekezo:\nPata alama ya chini inayohitajika kufaulu mtihani\n\n### Input:\nMtihani ulikuwa na maswali 100 ya chaguo nyingi yenye machaguo 4 kila moja\n\n### Majibu:\nAlama ya chini inayohitajika kufaulu mtihani ni 75."
},
{
"instruction": "Tengeneza sentensi ya mada kuanzisha maandishi yafuatayo.",
"input": "Kutokana na kuongezeka kwa vurugu katika eneo hilo, raia wengi wanakimbia makazi yao kwa kutafuta usalama.",
"output": "Kutokana na kuongezeka kwa mvutano na vurugu, raia wasiohesabika wanafurushwa kutoka makazi yao kwa hofu ya maisha yao.",
"text": "Hapo chini ni maelekezo yanayoelezea kazi, pamoja na input inayotoa muktadha zaidi. Andika jibu linalokamilisha ombi hilo kwa usahihi.\n\n### Maelekezo:\nTengeneza sentensi ya mada kuanzisha maandishi yafuatayo.\n\n### Input:\nKutokana na kuongezeka kwa vurugu katika eneo hilo, raia wengi wanakimbia makazi yao kwa kutafuta usalama.\n\n### Majibu:\nKutokana na kuongezeka kwa mvutano na vurugu, raia wasiohesabika wanafurushwa kutoka makazi yao kwa hofu ya maisha yao."
},
{
"instruction": "Andika kazi ya kuhesabu factorial ya namba iliyotolewa.",
"input": "",
"output": "def factorial(n):\n if n == 0:\n return 1\n return n * factorial(n-1)",
"text": "Hapo chini ni maelekezo yanayoelezea kazi. Andika jibu linalokamilisha ombi hilo kwa usahihi.\n\n### Maelekezo:\nAndika kazi ya kuhesabu factorial ya namba iliyotolewa.\n\n### Majibu:\ndef factorial(n):\n if n == 0:\n return 1\n return n * factorial(n-1)"
},
{
"instruction": "Andika kazi ya kubadilisha string iliyotolewa kuwa herufi kubwa.",
"input": "",
"output": "def toUpperCase(str):\n return str.upper()",
"text": "Hapo chini ni maelekezo yanayoelezea kazi. Andika jibu linalokamilisha ombi hilo kwa usahihi.\n\n### Maelekezo:\nAndika kazi ya kubadilisha string iliyotolewa kuwa herufi kubwa.\n\n### Majibu:\ndef toUpperCase(str):\n return str.upper()"
},
{
"instruction": "Toa namba chanya kutoka kwenye orodha?",
"input": "arr = [5,-2,8,-7,3,-1,0,5]",
"output": "[5, 8, 3, 5]",
"text": "Hapo chini ni maelekezo yanayoelezea kazi, pamoja na input inayotoa muktadha zaidi. Andika jibu linalokamilisha ombi hilo kwa usahihi.\n\n### Maelekezo:\nToa namba chanya kutoka kwenye orodha?\n\n### Input:\narr = [5,-2,8,-7,3,-1,0,5]\n\n### Majibu:\n[5, 8, 3, 5]"
}
swift
Copy code
{
"instruction": "Calculate the square root of a given number.",
"input": "",
"output": "def sqrt(n):\n low = 0\n high = n\n \n while low <= high:\n mid = (low + high) // 2\n if mid * mid == n:\n return mid\n elif mid * mid < n:\n low = mid + 1\n else:\n high = mid - 1\n \n return low - 1",
"text": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\nCalculate the square root of a given number.\n\n### Response:\ndef sqrt(n):\n low = 0\n high = n\n \n while low <= high:\n mid = (low + high) // 2\n if mid * mid == n:\n return mid\n elif mid * mid < n:\n low = mid + 1\n else:\n high = mid - 1\n \n return low - 1"
},
{
"instruction": "Reverse a linked list.",
"input": "",
"output": "def reverse(head): \n prev = None\n cur = head \n\n while cur:\n next = cur.next\n cur.next = prev \n prev = cur \n cur = next\n head = prev\n \n return head",
"text": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\nReverse a linked list.\n\n### Response:\ndef reverse(head): \n prev = None\n cur = head \n\n while cur:\n next = cur.next\n cur.next = prev \n prev = cur \n cur = next\n head = prev\n \n return head"
},
{
"instruction": "Compute the longest increasing subsequence of a given array?",
"input": "arr = [7, 10, 8, 11, 9, 5]",
"output": "[7, 8, 9, 11]",
"text": "Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.\n\n### Instruction:\nCompute the longest increasing subsequence of a given array?\n\n### Input:\narr = [7, 10, 8, 11, 9, 5]\n\n### Response:\n[7, 8, 9, 11]"
},
{
"instruction": "Design an algorithm to find the maximum profit of a stock buy and sell?",
"input": "",
"output": "def maxProfit(prices):\n min_price = float('inf')\n max_profit = 0\n\n for price in prices:\n min_price = min(min_price, price) \n profit = price - min_price\n max_profit = max(max_profit, profit)\n\n return max_profit",
"text": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\nDesign an algorithm to find the maximum profit of a stock buy and sell?\n\n### Response:\ndef maxProfit(prices):\n min_price = float('inf')\n max_profit = 0\n\n for price in prices:\n min_price = min(min_price, price) \n profit = price - min_price\n max_profit = max(max_profit, profit)\n\n return max_profit"
},
{
"instruction": "Given two strings, check whether one string is a rotation of another?",
"input": "s1 = ‘waterbottle’\ns2 = ‘erbottlewat’",
"output": "def isRotation(s1, s2):\n if len(s1) != len(s2):\n return False\n\n s3 = s1 + s1 \n return s3.find(s2) != -1",
"text": "Below is an instruction that describes a task, paired with an input that provides further context. Write a response that appropriately completes the request.\n\n### Instruction:\nGiven two strings, check whether one string is a rotation of another?\n\n### Input:\ns1 = ‘waterbottle’\ns2 = ‘erbottlewat’\n\n### Response:\ndef isRotation(s1, s2):\n if len(s1) != len(s2):\n return False\n\n s3 = s1 + s1 \n return s3.find(s2) != -1"
},
json
Copy code
{
"instruction": "Hesabu kikokotoo cha namba iliyotolewa.",
"input": "",
"output": "def sqrt(n):\n low = 0\n high = n\n \n while low <= high:\n mid = (low + high) // 2\n if mid * mid == n:\n return mid\n elif mid * mid < n:\n low = mid + 1\n else:\n high = mid - 1\n \n return low - 1",
"text": "Hapo chini ni maelekezo yanayoelezea kazi. Andika jibu linalokamilisha ombi hilo kwa usahihi.\n\n### Maelekezo:\nHesabu kikokotoo cha namba iliyotolewa.\n\n### Majibu:\ndef sqrt(n):\n low = 0\n high = n\n \n while low <= high:\n mid = (low + high) // 2\n if mid * mid == n:\n return mid\n elif mid * mid < n:\n low = mid + 1\n else:\n high = mid - 1\n \n return low - 1"
},
{
"instruction": "Geuza orodha iliyounganishwa.",
"input": "",
"output": "def reverse(head): \n prev = None\n cur = head \n\n while cur:\n next = cur.next\n cur.next = prev \n prev = cur \n cur = next\n head = prev\n \n return head",
"text": "Hapo chini ni maelekezo yanayoelezea kazi. Andika jibu linalokamilisha ombi hilo kwa usahihi.\n\n### Maelekezo:\nGeuza orodha iliyounganishwa.\n\n### Majibu:\ndef reverse(head): \n prev = None\n cur = head \n\n while cur:\n next = cur.next\n cur.next = prev \n prev = cur \n cur = next\n head = prev\n \n return head"
},
{
"instruction": "Hesabu mfululizo mrefu zaidi unaopanda wa orodha iliyotolewa?",
"input": "arr = [7, 10, 8, 11, 9, 5]",
"output": "[7, 8, 9, 11]",
"text": "Hapo chini ni maelekezo yanayoelezea kazi, pamoja na input inayotoa muktadha zaidi. Andika jibu linalokamilisha ombi hilo kwa usahihi.\n\n### Maelekezo:\nHesabu mfululizo mrefu zaidi unaopanda wa orodha iliyotolewa?\n\n### Input:\narr = [7, 10, 8, 11, 9, 5]\n\n### Majibu:\n[7, 8, 9, 11]"
},
{
"instruction": "Buni algorithm ya kupata faida ya juu zaidi ya kununua na kuuza hisa?",
"input": "",
"output": "def maxProfit(prices):\n min_price = float('inf')\n max_profit = 0\n\n for price in prices:\n min_price = min(min_price, price) \n profit = price - min_price\n max_profit = max(max_profit, profit)\n\n return max_profit",
"text": "Hapo chini ni maelekezo yanayoelezea kazi. Andika jibu linalokamilisha ombi hilo kwa usahihi.\n\n### Maelekezo:\nBuni algorithm ya kupata faida ya juu zaidi ya kununua na kuuza hisa?\n\n### Majibu:\ndef maxProfit(prices):\n min_price = float('inf')\n max_profit = 0\n\n for price in prices:\n min_price = min(min_price, price) \n profit = price - min_price\n max_profit = max(max_profit, profit)\n\n return max_profit"
},
{
"instruction": "Kwa kutumia string mbili, angalia iwapo moja ni mzunguko wa nyingine?",
"input": "s1 = ‘waterbottle’\ns2 = ‘erbottlewat’",
"output": "def isRotation(s1, s2):\n if len(s1) != len(s2):\n return False\n\n s3 = s1 + s1 \n return s3.find(s2) != -1",
"text": "Hapo chini ni maelekezo yanayoelezea kazi, pamoja na input inayotoa muktadha zaidi. Andika jibu linalokamilisha ombi hilo kwa usahihi.\n\n### Maelekezo:\nKwa kutumia string mbili, angalia iwapo moja ni mzunguko wa nyingine?\n\n### Input:\ns1 = ‘waterbottle’\ns2 = ‘erbottlewat’\n\n### Majibu:\ndef isRotation(s1, s2):\n if len(s1) != len(s2):\n return False\n\n s3 = s1 + s1 \n return s3.find(s2) != -1"
}
swift
Copy code
{
"instruction": "Create a timeline describing the history of the internet",
"input": "",
"output": "1968: ARPANET, the first internet network, is created.\n 1973: TCP/IP is created, allowing computers to communicate with each other.\n 1983: DNS is created to simplify the communication process. \n 1989: The World Wide Web is created, giving birth to the public internet.\n 1995: JavaScript is developed, introducing dynamic content to the web.\n 2001: Wikipedia is launched, providing an online encyclopedia.\n 2004: Facebook is launched, growing quickly to 1 billion users.\n 2007: Apple introduces the iPhone, making mobile devices commonplace.\n 2009: Cloud computing begins to revolutionize data storage. \n 2011: HTML5 is released, encouraging richer web experiences.\n 2013: The Internet of Things (IoT) emerges, connecting dozens of durable devices. \n 2015: \"Voice first\" technology, such as Amazon's Alexa, launches.\n 2018: 5G networks begin rolling out, allowing for faster connection speeds.\n 2020: AI begins to be used to power home assistants like Alexa.",
"text": "Below is an instruction that describes a task. Write a response that appropriately completes the request.\n\n### Instruction:\nCreate a timeline describing the history of the internet\n\n### Response:\n1968: ARPANET, the first internet network, is created.\n 1973: TCP/IP is created, allowing computers to communicate with each other.\n 1983: DNS is created to simplify the communication process. \n 1989: The World Wide Web is created, giving birth to the public internet.\n 1995: JavaScript is developed, introducing dynamic content to the web.\n 2001: Wikipedia is launched, providing an online encyclopedia.\n 2004: Facebook is launched, growing quickly to 1 billion users.\n 2007: Apple introduces the iPhone, making mobile devices commonplace.\n 2009: Cloud computing begins to revolutionize data storage. \n 2011: HTML5 is released, encouraging richer web experiences.\n 2013: The Internet of Things (IoT) emerges, connecting dozens of durable devices. \n 2015: \"Voice first\" technology, such as Amazon's Alexa, launches.\n 2018: 5G networks begin rolling out, allowing for faster connection speeds.\n 2020: AI begins to be used to power home assistants like Alexa."
},